﻿using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}

	void OnGUI()
	{
		// löytyykö pelaajaa?
		if(GameObject.FindGameObjectWithTag("Player") == null)
		{
			// sijainti
			float x = Screen.width / 2;
			float y = Screen.height / 2;

			// leveys ja korkeus
			float w = 500;
			float h = 30;

			GUI.Label (new Rect(x,y,w,h),"Hahaa! Kuolit, paina 'R'");
		}
	}

	
	// Update is called once per frame
	void Update () {



		// Kentän restartti
		if(Input.GetKeyDown("r"))
			Application.LoadLevel(Application.loadedLevel);

	}
}
